<!DOCTYPE html>
<html>
<head>
    <title>用户电影票管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <#include "../../../../include/resources.html">
        <script type="text/javascript">
            var dataGrid;

            $(function() {
                dataGrid = $('#dataGrid').datagrid({
                    url : 'userMovieTicketList.html',
                    fit : true,
                    border : false,
                    pagination : true,
                    idField : 'id',
                    pageSize : pageSize,
                    pageNums :1,
                    pageList : pageList,
                    sortName : 'id',
                    sortOrder : 'asc',
                    checkOnSelect : false,
                    selectOnCheck : false,
                    nowrap : false,
                    singleSelect:true,
                    columns : [ [
                        { field: 'id', title: '编号', width: 50, fixed: true,checkbox : false},
                        { field: 'ruleName', title: '名称',fixed:true, width: 120, sortable:false, formatter: function(value, row, index) {
                            if(row.ruleName != null){
                                return value;
                            }else{
                                return "其他";
                            }
                        }},
                        { field: 'userName', title: '用户名', WIDTH: 100, fixed:true,sortable:false },
                        { field: 'realName', title: '用户真实姓名', width: 100, fixed:true,sortable:false },
                        {
                            field: 'status',
                            title: '状态',
                            fixed: true,
                            width: 80,
                            sortable: false,
                            formatter: function (value, row, index) {
                                if (row.status == 0) return "未使用";
                                else if(row.status ==1) return "已使用";
                                else if(row.status == 2) return "已过期";
                                else if(row.status == 3) return "无效"
                            }
                        },
                        { field: 'count', title: '电影票个数',fixed:true, width: 120, sortable:false},
                        { field: 'addTime', title: '获取时间',fixed:true, width: 180, sortable:false,formatter: function(value,row,index){
                            return getLocalTime(value,4);
                        }
                        },   
                        { field: 'endTime', title: '过期时间',fixed:true, width: 180, sortable:false,formatter: function(value,row,index){
                            return getLocalTime(value,4);
                        }
                        },
                        { field: 'sourceType', title: '获取来源', width: 100, sortable:false },
                        { field: 'description', title: '描述',fixed:true, width: 120, sortable:false}] ],
                    toolbar : '#toolbar'
                });
            })
        </script>
</head>
<body style="padding:0 20px;" >
<div class="easyui-layout" data-options="fit : true,border : false">
    <div data-options="region:'north',border:false,collapsible:false" id="searchBox">
        <div class="sLeft">
            <form id="searchForm">
                <input type="text"  name="searchName" id="searchName" class="sInput" placeholder="输入用户名或真实姓名进行搜索" autocomplete="off" onkeydown="if(event.keyCode == 13){ $.fn.dataGridOptions.searchFun('#searchForm');return false;}"/><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a><a href="javascript:;" class="advBtn" title="条件查询">条件查询 <i class="iconfont">&#xe638;</i></a>
                <a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
            </form>
        </div>
        <form id="showAdw">
            <ul class="showAdw" style="display:none;">
                <a href="javascript:void(0);"><i class="iconfont closeWin">&#xe63a;</i></a>
                <li><span>用户名</span><input type="text" name="realName" id="userName" placeholder="输入用户名或真实姓名进行搜索" autocomplete="off"/></li>
                <li><span>名称</span><input type="text" name="ruleName"  id="name" placeholder="输入名称进行搜索" autocomplete="off"/></li>
                <li><span>用户电影票状态</span>
                    <select name="status" id="status" class="status">
                        <option value=99>全部</option>
                        <option value="1">已使用</option>
                        <option value="0">未使用</option>
                        <option value="2">已过期</option>
                        <option value="3">无效</option>
                    </select>
                </li>
                <li><span></span><a href="javascript:void(0);" class="searchBtn sureBtn" onclick="$.fn.dataGridOptions.searchFun('#showAdw');">确定</a><a href="javascript:void(0);" class="searchBtn" onclick="$.fn.dataGridOptions.cleanFun('#searchForm');">重置</a></li>
            </ul>
        </form>
    </div>
    <div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
        <table id="dataGrid"></table>
    </div>
</div>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>